package cn.wx.common;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Configuration;

/**
 * 微信服务注册实现
 *
 * @author: sunshaoping
 * @date: Create by in 3:37 下午 2020/5/25
 */
@Configuration
public class WxServiceRegisterImpl implements WxServiceRegister {

    private final ConfigurableBeanFactory beanRegistry;

    public WxServiceRegisterImpl(ConfigurableBeanFactory beanRegistry) {
        this.beanRegistry = beanRegistry;
    }

    @Override
    public void register(String name, Object service) {
        beanRegistry.registerSingleton(name, service);
    }
}
